﻿/*--------------------------------------------------------------------\
|       _____ _                      __  __ _    _  _____ _    _      |
|      / ____| |                    |  \/  | |  | |/ ____| |  | |     |
|     | (___ | |__   __ _ _ __ _ __ | \  / | |  | | (___ | |__| |     |
|      \___ \| '_ \ / _` | '__| '_ \| |\/| | |  | |\___ \|  __  |     |
|      ____) | | | | (_| | |  | |_) | |  | | |__| |____) | |  | |     |
|     |_____/|_| |_|\__,_|_|  | .__/|_|  |_|\____/|_____/|_|  |_|     |
|                             | |                                     |
|                             |_| Copyright(C) Shawn Sagady 2010      |
|=-------------------------------------------------------------------=|
|   Please reference the CREDITS.TXT file for license and credits.    |
\--------------------------------------------------------------------*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace SharpMUSH
{
    static class DB
    {
        static int lastDBRef;
        public static FileInfo File;
        static StreamWriter Writer;
        
        
        /// <summary>
        /// Set the file to be used for the DB dump.
        /// </summary>
        /// <param name="file">FileInfo of target file.</param>
        static void SetFile(FileInfo file)
        {
            Writer = new StreamWriter(file.FullName);
        }

        /// <summary>
        /// Write a labeled string into the database
        /// </summary>
        /// <param name="label"></param>
        /// <param name="value"></param>
        static void WriteLabeledString(string label, string value)
        {
            Writer.Write("{0} {1}\n", label, value);
        }

        /// <summary>
        /// Write a labeled int into the database
        /// </summary>
        /// <param name="label"></param>
        /// <param name="value"></param>
        static void WriteLabeledInt(string label, int value)
        {
            Writer.Write("{0} {1}\n", label, value);
        }
        
        ///// <summary>
        ///// Write a labeled DBRREF into the database
        ///// </summary>
        ///// <param name="label"></param>
        ///// <param name="value"></param>
        //static void WriteLabeledDBREF(string label, int value)
        //{
        //    Writer.Write("{0} #{1}\n", label, value);
        //}

        //static void putlocks(List<Lock> ll)
        //{
        //    WriteLabeledInt("lockcount", ll.Count);

        //    foreach(Lock l in ll)
        //    {
        //        WriteLabeledString(" type", l.Type.ToString());

                

        


        
            
    }
}
